import Vue from 'vue'
import Router from 'vue-router'

// 商品列表
import GoodsList from '@/views/GoodsList'
// 购物车
import Cart from '@/views/Cart'
// 地址
import Address from '@/views/Address'
// 确认订单
import OrderConfirm from '@/views/OrderConfirm'
// 支付成功
import OrderSuccess from '@/views/OrderSuccess'

Vue.use(Router);

export default new Router({
  routes: [
    // 商品列表
    {
      path: '/',
      name: 'GoodsList',
      component:GoodsList
    },
    // 购物车
    {
      path: '/cart',
      name: 'Cart',
      component:Cart
    },
    // 没有登录，跳转到商品列表页
    {
      path: '/goods',
      name: 'GoodsList',
      component: GoodsList
    },
    // 选择地址
    {
      path: '/address',
      name: 'Address',
      component:Address
    },
    // 确认订单
    {
      path: '/orderConfirm',
      name: 'OrderConfirm',
      component: OrderConfirm
    },
    {
      path: '/orderSuccess',
      name: 'OrderSuccess',
      component:OrderSuccess
    }
  ]
})
